import java.util.*;
import java.util.stream.Stream;

public class test {
    public static void main(String[] args) {
        List<String> strings = new ArrayList<>();
        strings.add("apple");
        strings.add("banana");
        strings.add("apple");
        strings.add("orange");
        strings.add("banana");
        strings.add("grape");
        strings.add("grape");
        List<String> newList = new ArrayList<>();
        HashMap<String, Integer> count = new HashMap<>();
        for (String str : strings) {
            count.keySet(str)++
        }
    }
}
